<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
//本地存储：可以让浏览器持久化存储数据，通过localStorage对象实现！
//存储数据:两个参数KV
//   localStorage.setItem("INFO","东风导弹");
//   //读取数据:通过K获取存储V
//   let result = localStorage.getItem("INFO");
//   //删除浏览器存储数据
//   localStorage.removeItem("INFO");
//   console.log(result)
</script>
<script>
    //引用类型的数据|一般存储字符串
    let data  = [{a:1},{b:2}];
    //可以转换为字符串
    localStorage.setItem("TOKEN",JSON.stringify(data));
    //读取
    let result = JSON.parse(localStorage.getItem("TOKEN"));
    console.log(result[0]);
 
</script>